﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<BugzX.Models.ProjectViewViewData>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="contentMain" runat="server">

    <% if (this.User.Identity.IsAuthenticated)
       { %>
    <button id="buttonAddBug" class="addBug">Add Bug/TODO</button>
    <% } %>

    <header><%: this.Model.Name %></header>
    <section class="bugRoadMap">
        <div id="tabs">
            <ul>
                <li><a href="#tabRoadmap">Roadmap</a></li>
                <li><a href="#tabDetails">Details</a></li>
            </ul>
            <div id="tabRoadmap">
                <div id="bugListAccordion">
                    <% foreach (var component in this.Model.Components)
                       { %>
                        <h3><a href="#"><%: component.Name %> - (<%: component.Bugs.Count %>)</a></h3>
                        <div>
                            <% Html.RenderPartial("ViewBugsPartial", new BugzX.Models.BugViewPartialViewData()
                               {
                                   Bugs = component.Bugs.ToList(),
                                   AddedBugId = this.Model.AddedBugId,
                               }); %>
                        </div>
                    <% } %>
                </div>
            </div>
            <div id="tabDetails">
                hello
            </div>
        </div>
    </section>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentJQuery" runat="server">

    $("#bugListAccordion").accordion();

    $("#tabs").tabs({

        selected: 0
    });

    <% if (this.User.Identity.IsAuthenticated)
       { %>
    $("#buttonAddBug")
        .button()
        .click(function () {

            window.location = "/bug/new/<%: this.Model.Name %>";
        });
    <% } %>

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contentHead" runat="server">

</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="contentErrorMessage" runat="server">
</asp:Content>
